﻿@model List<RiderShop.Mobile.ServiceEntity.Product.ProductBasicInfoExtend>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <title>蓉记鲜鲜鲜粮品季</title>
    <link rel="stylesheet" href="~/Themes/RongJi/Style/presell/css/presell.css">
    <link rel="stylesheet" href="~/Themes/RongJi/Style/presell/css/parallax.css">
    <link rel="stylesheet" href="~/Themes/RongJi/Style/presell/css/parallax-animation.css">
</head>
<body>
<div class="wrapper">
    <span class="redline"></span>
    <div class="toolbar">
        <a href="javascript:window.history.go(-1)" class="goback">返回</a>
        <a href="http://m.rongji365.com/" class="gohome">首页</a>
        <h1 id="toolbarTitle">预售</h1>
        <div class="hot">新品预售<em><span class="hotIcon">HOT</span></em></div>
    </div>
    <div class="pages">
         @foreach (var item in Model)
         {
             if (string.IsNullOrEmpty(item.TSImage))
             {
                 continue; 
             }

             var bgUrl = RiderShop.Mobile.Common.Component.SiteUrl.FormatProductImageUrl(Kevin.Shop.Business.Service.Entity.Products.Enumerations.ImageType.Size960, item.ProductId, item.TSImage);
             
            <section class="page" id="section1" style="background-image:url(@bgUrl);background-size:cover;background-position:center center;"></section>
            <div class="intro">
                <h2>@item.Title</h2>
                <h3>@item.LineDescription</h3>
               
                @*<h3>味甜微酸，果肉细腻无丝<span class="spec">8斤/箱</span></h3>*@
                <div class="price">
                    <span class="money">
                        <a href="~/Product/ProductDetail?prd=@item.ProductId">商品详情 &gt;</a>￥@item.UnitPriceFormat
                        <del>市场价:￥@item.MarketPrice</del>
                    </span>
                    <div class="btn-group">
                       @if (@item.TotalInventory > 0 && @item.Active)
                        {
                            <a href="javascript:void(0)" onclick="addToCart('@item.ProductId')" class="btn btn-red">&nbsp;&nbsp;&nbsp;&nbsp;抢&nbsp;&nbsp;&nbsp;&nbsp;</a>
                        }
                        else
                        {
                            <a href="javascript:void(0)"  class="btn btn-red">已抢完</a>
                        }
                    </div>
                </div>
            </div>
         }
       @* <section class="page" id="section2" style="background-image:url(/Themes/RongJi/Style/presell/temp/2.jpg);background-size:cover;background-position:center center;"></section>
        <div class="intro">
            <h2>海南金煌芒</h2>
            <h3>果实硕大，肉质嫩滑<span class="spec">8斤/箱</span></h3>
            <div class="price">
                <span class="money">
                    <a href="">商品详情 &gt;</a>￥158.00
                    <del>市场价:￥188.00</del>
                </span>
                <div class="btn-group">
                    <a href="" class="btn btn-red">立即购买</a>
                </div>
            </div>
        </div>

        <section class="page" id="section3" style="background-image:url(/Themes/RongJi/Style/presell/temp/3.jpg);background-size:cover;background-position:center center;"></section>
        <div class="intro">
            <h2>海南大台农芒</h2>
            <h3>肉细皮薄，浓郁香甜<span class="spec">8斤/箱</span></h3>
            <div class="price">
                <span class="money">
                    <a href="">商品详情 &gt;</a>￥105.00
                    <del>市场价:￥125.00</del>
                </span>
                <div class="btn-group">
                    <a href="" class="btn btn-red">立即购买</a>
                </div>
            </div>
        </div>

        <section class="page" id="section4" style="background-image:url(/Themes/RongJi/Style/presell/temp/4.jpg);background-size:cover;background-position:center center;"></section>
        <div class="intro">
            <h2>海南大贵妃芒</h2>
            <h3>果皮色彩艳丽 , 肉厚汁多<span class="spec">8斤/箱</span></h3>
            <div class="price">
                <span class="money">
                    <a href="">商品详情 &gt;</a>￥108.00
                    <del>市场价:￥168.00</del>
                </span>
                <div class="btn-group">
                    <a href="" class="btn btn-red">立即购买</a>
                </div>
            </div>
        </div>

        <section class="page" id="section5" style="background-image:url(/Themes/RongJi/Style/presell/temp/5.jpg);background-size:cover;background-position:center center;"></section>
        <div class="intro">
            <h2>海南小台农芒</h2>
            <h3>肉细皮薄，浓郁香甜<span class="spec">8斤/箱</span></h3>
            <div class="price">
                <span class="money">
                    <a href="">商品详情 &gt;</a>￥99.00
                    <del>市场价:￥128.00</del>
                </span>
                <div class="btn-group">
                    <a href="" class="btn btn-red">立即购买</a>
                </div>
            </div>
        </div>
      
        <section class="page" id="section6" style="background-image:url(/Themes/RongJi/Style/presell/temp/6.jpg);background-size:cover;background-position:center center;"></section>
        <div class="intro">
            <h2>海南小贵妃芒</h2>
            <h3>果皮色彩艳丽 , 肉厚汁多<span class="spec">8斤/箱</span></h3>
            <div class="price">
                <span class="money">
                    <a href="">商品详情 &gt;</a>￥105.00
                    <del>市场价:￥135.00</del>
                </span>
                <div class="btn-group">
                    <a href="" class="btn btn-red">立即购买</a>
                </div>
            </div>
        </div>*@

    </div>
</div>
    <script src="~/Themes/RongJi/Style/presell/js/zepto.min.js"></script>
    <script src="~/Themes/RongJi/Style/presell/js/parallax.js"></script>
  
     
<script>
    //添加到购物车并跳转到购物车页面
    function addToCart(productId) {
        //alert(productId);
        KevinShop.Common.ShoppingCart.UpdateToCart(productId, 1);
        window.location.href = '/Purchase/ShoppingCart';


        //KevinShop.MessageBox.Success("添加到购物车成功！");
    }
    $('.pages').parallax({
        direction: 'vertical',  // horizontal (水平翻页)
        swipeAnim: 'cover',     // cover (切换效果)
        drag: true,        // 是否允许拖拽 (若 false 则只有在 touchend 之后才会翻页)
        loading: true,       // 有无加载页
        indicator: false,       // 有无指示点
        arrow: true,        // 有无指示箭头
        /*
         * 翻页后立即执行
         * {int}        index: 第几页
         * {DOMElement} element: 当前页节点
         * {String}     directation: forward(前翻)、backward(后翻)、stay(保持原页)
         */
        onchange: function (index, element, direction) {
            // code here...
            // console.log(index, element, direction);
            $('section.current').next('.intro').show();
            $('section.current').siblings('.page').next('.intro').hide();
        },
        /*
         * 横竖屏检测
         * {String}     orientation: landscape、protrait
         */
        orientationchange: function (orientation) {
            // console.log(orientation);
        }
    });

    $('.redline').css({
        top: $('.toolbar').height() - 3,
        left: $('.goback').width(),
        width: $('#toolbarTitle').width() - 1
    });

    $('.hot').css({
        margin: '0 36px'
    });

</script>
    <!-- 因为没有继承母版页，但是又要用到KevinShop.Common.ShoppingCart所以需要引用下面4个js文件 -->
    <script src="~/Themes/RongJi/Style/base/js/jquery-1.10.1.min.js"></script>
    <script type="text/javascript" src="~/Utility/pages/pg_common.js" charset="gb2312"></script>
    <script type="text/javascript" src="~/Utility/pages/pg_global.js"></script>
    <script type="text/javascript" src="~/Utility/pages/jquery.cookie.js"></script>

<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">

    window.config = {
        link: 'http://m.rongji365.com/Product/PresellProduct',
        imgUrl: 'http://m.rongji365.com/Themes/RongJi/Style/presell/img/logo.jpg',
        img_url: 'http://m.rongji365.com/Themes/RongJi/Style/presell/img/logo.jpg',
        title: '蓉记鲜鲜鲜-立夏·粮品季预售开启！',
        desc: '立夏粮品，产地直供，蓉记鲜鲜鲜，预售鲜享有礼！',

    };
    window.timelineconfig = {
        link: 'http://m.rongji365.com/Product/PresellProduct',
        imgUrl: 'http://m.rongji365.com/Themes/RongJi/Style/presell/img/logo.jpg',
        img_url: 'http://m.rongji365.com/Themes/RongJi/Style/presell/img/logo.jpg',
        title: '蓉记鲜鲜鲜-立夏·粮品季预售开启！',
    };
    function onBridgeReady() {
        WeixinJSBridge.call('showOptionMenu');
    }

    if (typeof WeixinJSBridge == "undefined") {
        if (document.addEventListener) {
            document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
        } else if (document.attachEvent) {
            document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
            document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
        }
    } else {
        onBridgeReady();
    }

    document.addEventListener('WeixinJSBridgeReady', function () {
        var WJ = WeixinJSBridge;

        WJ.on('menu:share:appmessage', function () {
            WJ.invoke('sendAppMessage', config, function (res) {
                // _report('sendAppMessage', res.err_msg);
            });
        });

        WJ.on('menu:share:timeline', function () {
            config.title = config.title + config.desc;
            WJ.invoke('shareTimeline', config, function (res) {
                // _report('shareTimeline', res.err_msg);
            });
        });

        WJ.on('menu:share:weibo', function () {
            WJ.invoke('shareWeibo', config, function (res) {
                // _report('shareWeibo', res.err_msg);
            });
        });
    });

    $(function () {
        var postData = {
            "currentUrl": location.href.split('#')[0]
        }
        $.post("/WeixinJsSdk/ConfigScriptJson", postData, function (wxConfig) {
            //wxConfig = JSON.parse(wxConfig);
            //wxConfig.debug = true;
            wxConfig.jsApiList.push("showOptionMenu");
            wx.config(wxConfig);

            wx.ready(function () {

                var config = window.config;
                wx.onMenuShareAppMessage(config);
                wx.onMenuShareTimeline(window.timelineconfig);
                wx.onMenuShareQQ(config);
                wx.onMenuShareWeibo(config);

                wx.showOptionMenu();
            });

            wx.error(function (res) {

            });
        });
    });
</script>
<!--Static Code Start-->
<img src="http://img.tongji.linezing.com/3547905/tongji.gif" style="display:none;">
<script type="text/javascript">
    var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
    document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3Fd2c430d3acdc174f29f6feef73ea35fa' type='text/javascript'%3E%3C/script%3E"));
</script>
<!-- Piwik -->
<script type="text/javascript">
    var _paq = _paq || [];
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);
    (function () {
        var u = "//analytics.it-hsmedia.com/";
        _paq.push(['setTrackerUrl', u + 'piwik.php']);
        _paq.push(['setSiteId', 2]);
        var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
        g.type = 'text/javascript'; g.async = true; g.defer = true; g.src = u + 'piwik.js'; s.parentNode.insertBefore(g, s);
    })();
</script>
<noscript><p><img src="//analytics.it-hsmedia.com/piwik.php?idsite=2" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
<!--Static Code End-->
</body>
</html>

